#include "LogicDemo.h"

namespace Pulse
{
	SampleLogic::SampleLogic( void )
	{
		FileIO file;

		file.Open( L"testDoc.txt", FileIO::FILEOP_BINARY | FileIO::FILEOP_WRITE );
		file.WriteString( L"Hello World" );
		file.Close();

		GraphicsResourceManager *pGM = GraphicsResourceManager::GetInstance();
		Texture2DDesc desc;
		desc.SetAsyncLoad( TRUE );
		desc.SetToLoad( PSX_String("Resources\\Textures\\funnehCat.jpg") );
		m_pTexture = GraphicsResourceManager::GetInstance()->CreateTexture2D( desc.filename.GetBuffer(), &desc ); 

		//ShaderDesc shaderDesc;
		//shaderDesc.SetAsVertexShader( PSX_String("Resources\\Effects\\Techniques\\Shaders\\WireframeVS.fxs"), 
		//	PSX_String("VS") );

		//pGM->CreateVertexShader( shaderDesc.filename.GetBuffer(), &shaderDesc );

	}

	void SampleLogic::OnUpdate( DOUBLE time, FLOAT dt )
	{
		if ( m_pTexture->IsLoaded() )
		{
			PSX_PushLog1( "Loaded!!!" );
		
			while( true );
		}
		else
			PSX_PushLog1( "Not yet loaded" );

	}
}